$(function() {
    /*-------轮播代码-------*/
    var topSlide = $('.slider-banner').bxSlider({
        'mode': "fade",
        'displaySlideQty': 1, //定义显示个数
        'moveSlideQty': 1, //移动个数
        'speed': 400,
        "auto": true,
        'pagerCustom': '#bx-pager',
        'pause': 4000
    })
    $(".top-slider").on("mouseover", function() {
        topSlide.stopAuto();
    }).on("mouseout", function() {
        topSlide.startAuto();
    });
    $("#bx-pager").find(".pager-links").each(function() {
        var timer;
        var self = $(this);
        self.on("mouseenter", function() {
            timer = setTimeout(function() {
                var thumbIndex = $("#bx-pager a").index(self);
                topSlide.goToSlide(thumbIndex)
            }, 400)
        }).on("mouseleave", function() {
            clearTimeout(timer)
        })
    });
    /*-------轮播代码-------*/
    /*-------下拉菜单-------*/
    $("#headr-nav-box").on("mouseenter", '.first-name', function() {
        var me = $(this);

        if (me.find(".nav-son").length > 0) {
            me.find(".nav-son").slideDown(300);
        }
    }).on("mouseleave", '.first-name', function() {
        var me = $(this);

        if (me.find(".nav-son").length > 0) {
            me.find(".nav-son").slideUp(100)
        }
    })
    $("#headr-nav-box").on("mouseenter", '.second-name', function() {
        var me = $(this);
        
        if (me.find(".son-navlist").length > 0) {
           me.addClass("on")
            me.find(".son-navlist").slideDown(300);
        }
    }).on("mouseleave", '.second-name', function() {
        var me = $(this);

        if (me.find(".son-navlist").length > 0) {

            me.find(".son-navlist").slideUp(100);
            me.removeClass("on")
        }
    })
    /*-------下拉菜单-------*/
})